package com.dhcc.sds.busi.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dhcc.cdc.busi.service.ICdcHospitalService;
import com.dhcc.cdc.busi.service.ICdcUserService;
import com.dhcc.cdc.sys.cache.config.CdcConfigCache;
import com.dhcc.cdc.sys.service.IConfigurationService;
import com.dhcc.sdc.busi.service.ISdcBusiQcTriggeredService;
import com.dhcc.sdc.busi.service.ISdcQcAnalysisDicService;
import com.dhcc.sdc.busi.service.ISdcReportAnalysisDicService;
import com.dhcc.sds.base.service.ISdsCommonService;
import com.dhcc.sds.base.service.ISdsQcentityService;
import com.dhcc.sds.busi.service.IAnalysisSdsPortalService;
import com.dhcc.sds.busi.service.ISdsQcincaseDataService;
import com.dhcc.sds.busi.service.ISdsQcincaseService;
import com.dhcc.sds.busi.vo.AnalysisSdsPortalVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * 单病种门户新版
 *
 * @author zhangdc
 * @ClassName: AnalysisSdsQcPortalController
 * @Description: TODO
 * @date 2022-05-31 10:09:15
 */
@Controller
@RequestMapping("${sys.backendPath}/analysis/qcportal")
public class AnalysisSdsQcPortalController {

    private String PREFIX = "/backend/sds/qcportal/";

    @Autowired
    private ISdsCommonService sdsCommonService;
    @Autowired
    private ISdsQcincaseDataService sdsQcincaseDataService;
    @Autowired
    private IAnalysisSdsPortalService analysisSdsPortalService;
    @Autowired
    private ICdcHospitalService cdcHospitalService;
    @Autowired
    private ICdcUserService cdcUserService;
    @Autowired
    private ISdsQcentityService sdsQcentityService;
    @Autowired
    private ISdsQcincaseService sdsQcincaseService;
    @Autowired
    private ISdcBusiQcTriggeredService sdcBusiQcTriggeredService;
    @Autowired
    private ISdcQcAnalysisDicService sdcQcAnalysisDicService;
    @Autowired
    private ISdcReportAnalysisDicService sdcReportAnalysisDicService;
    @Autowired
    private IConfigurationService configurationService;

    /**
     * @Description: 单病种门户
     * @Title:
     * @author: zhangdc
     * @date:2022-03-22 10:09:15
     */
    @RequestMapping("")
    public String index(Model model) {
        //获取部门信息
        JSONArray officMap = cdcHospitalService.getOfficeMap();
        //默认加载所有科室
        JSONArray departMap = sdsCommonService.getDepartMap(new HashMap<>());
        //获取病种
        JSONArray entityMap = sdsQcentityService.getUpEntityMap();
        //获取病种的年份
        JSONArray yearMap = sdsQcincaseService.getYearMap();
        //获取病种的月份
        JSONArray monthMap = sdsQcincaseService.getMonthMap();
        // 是否启用过程质控
        String enableIPQC = CdcConfigCache.me().getValueByKey("SDS", "EnableIPQCModule");
        String enableGeneralInfo = CdcConfigCache.me().getValueByKey("SDS", "EnableGeneralInfo");
        String enableDisFillingInfo = CdcConfigCache.me().getValueByKey("SDS", "EnableDisFillingInfo");
        String enableDisReportInfo = CdcConfigCache.me().getValueByKey("SDS", "EnableDisReportInfo");
        model.addAttribute("enableIPQC", enableIPQC);
        model.addAttribute("enableGeneralInfo", enableGeneralInfo);
        model.addAttribute("enableDisFillingInfo", enableDisFillingInfo);
        model.addAttribute("enableDisReportInfo", enableDisReportInfo);
        model.addAttribute("officeMap", officMap);
        model.addAttribute("departMap", departMap);
        model.addAttribute("entityMap", entityMap);
        model.addAttribute("yearMap", yearMap);
        model.addAttribute("monthMap", monthMap);

        return PREFIX + "qcportal.html";
    }

    /**
     * @Description: 查询单病种上报总体情况
     * @Title: buildRepInfo
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("buildRepInfo")
    @ResponseBody
    public Object buildRepInfo(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        params.put("userLinkHospId", sdsCommonService.getHospIdBySysUser());
        return analysisSdsPortalService.buildRepInfo(params);
    }

    /**
     * @Description: 查询近一年单病种上报情况
     * @Title: selectNearYearRep
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("selectNearYearRep")
    @ResponseBody
    public Object selectNearYearRep(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        params.put("userLinkHospId", sdsCommonService.getHospIdBySysUser());
        return analysisSdsPortalService.selectNearYearRep(params);
    }

    /**
     * @Description: 获取病种开展情况
     * @Title: selectQCOpenSum
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("selectQCOpenSum")
    @ResponseBody
    public Object selectQCOpenSum(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectQCOpenSum(params);
    }

    /**
     * @Description: 查询单病种费用/住院日
     * @Title: selectQCSysInfo
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("selectQCSysInfo")
    @ResponseBody
    public Object selectQCSysInfo(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectQCSysInfo(params);
    }

    /**
     * @Description: 查询病种上报情况
     * @Title: selectDimUpLoadData
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("selectQCUpLoadData")
    @ResponseBody
    public Object selectQCUpLoadData(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectQCUpLoadData(params);
    }

    /**
     * @Description: 查询科室上报情况
     * @Title: selectLocUpLoadData
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("selectLocUpLoadData")
    @ResponseBody
    public Object selectLocUpLoadData(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectLocUpLoadData(params);
    }

    /**
     * @Description: 查询医生上报情况
     * @Title: selectDocUpLoadData
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("selectDocUpLoadData")
    @ResponseBody
    public Object selectDocUpLoadData(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectDocUpLoadData(params);
    }


    /**
     * @Description: 查询病种自动填报率
     */
    @RequestMapping("selectQCARatio")
    @ResponseBody
    public Object selectQCARatio(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectQCARatio(params);
    }


    /**
     * @Description: 查询病种质控统计
     */
    @RequestMapping("selectQCCategory")
    @ResponseBody
    public Object selectQCCategory(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectQCCategory(params);
    }

    /**
     * @Description: 查询病种质控触发趋势统计
     */
    @RequestMapping("selectTriggerCountByDate")
    @ResponseBody
    public Object selectTriggerCountByDate(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectTriggerCountByDate(params);
    }

    /**
     * @Description: 查询医生质控数据统计
     */
    @RequestMapping("selectDoctorChartData")
    @ResponseBody
    public Object selectDoctorChartData(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectDoctorChartData(params);
    }

    /**
     * @Description: 查询病种质控统计(条件)
     */
    @RequestMapping("selectQCCategoryByCondition")
    @ResponseBody
    public Object selectQCCategoryByCondition(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectQCCategoryByCondition(params);
    }

    /**
     * @Description: 查询病种填报用时分析
     * @Title: selectQCUseTime
     * @return: Object
     * @author: zhangdc
     * @date:2022-03-23 10:09:15
     */
    @RequestMapping("selectQCUseTime")
    @ResponseBody
    public Object selectQCUseTime(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectQCUseTime(params);
    }

    /**
     * 查询科室未填报病种
     */
    @RequestMapping("selectQCDept")
    @ResponseBody
    public Object selectQCDept(@RequestParam Map<String, Object> params) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectQCDept(params);
    }

    /**
     * 查询医生触发详情
     */
    @RequestMapping("selectDocDetail")
    @ResponseBody
    public Object selectDocDetail(@RequestParam Map<String, Object> params) {
        params.put("allEpi","selectAllEpiData");
        return analysisSdsPortalService.selectAllDoctorData(params);
    }

    /**
     * 查询触发病人详情
     */
    @RequestMapping("selectPatDetail")
    @ResponseBody
    public Object selectPatDetail(@RequestParam Map<String, Object> params) {

        return analysisSdsPortalService.selectPatDetail(params);
    }


    /**
     * 跳转到关注病例列表
     */
    @RequestMapping("detailslist")
    public String detailslist(@RequestParam String idName, Model model) {
        Map<String, Object> params = new HashMap<>();
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        //获取部门信息
        JSONArray officMap = cdcHospitalService.getOfficeMap();
        //默认加载所有科室
        //JSONArray departMap = cdcLocationService.getDepartMap();
        //加载用户关联科室
        JSONArray departMap = sdsCommonService.getDepartMap(new HashMap<>());
        //状态
        JSONArray statusMap = sdsCommonService.getDicCodeArray("SDQCMrStatus");
        //主任医师
        JSONArray docMap = cdcUserService.getUserMap("DOCTOR5");
        //获取病种
        JSONArray entityMap = sdsQcentityService.getUpEntityMap();
        //String idName = params.get("idName").toString();
        List<AnalysisSdsPortalVo> sdsQcentityEntities;
        if (Objects.equals("LocSumMore", idName) || Objects.equals("DocSumMore", idName) || Objects.equals("QCSumMore", idName)) {
            //sdsQcentityEntities = sdsQcincaseOperlogService.selectLocSumChartData(params);
            sdsQcentityEntities = analysisSdsPortalService.selectSumChartData(idName, params);
        } else {
            sdsQcentityEntities = analysisSdsPortalService.selectMrlistDataDetails(idName, deptIds);
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("data", sdsQcentityEntities);
        model.addAttribute("data", jsonObject);
        model.addAttribute("officeMap", officMap);
        model.addAttribute("departMap", departMap);
        model.addAttribute("statusMap", statusMap);
        model.addAttribute("docMap", docMap);
        model.addAttribute("entityMap", entityMap);
        model.addAttribute("idName", idName);
        model.addAttribute("hospitalId", sdsCommonService.getHospIdBySysUser());
        return PREFIX + "portalMrlist.html";
    }

    /**
     * 跳转病种质控详情
     */
    @RequestMapping("qcDetail")
    public String qcDetail(@RequestParam Map<String, Object> params, Model model) {
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        JSONObject jsonObject = analysisSdsPortalService.selectQcDetail(params);
        model.addAttribute("data", jsonObject);
        return PREFIX + "portalQcDetail.html";
    }


//    /**
//     * 跳转到病种自动填报率分析列表
//     */
//    @RequestMapping("autoRatio")
//    public String autoRatio(@RequestParam Map<String, Object> params, Model model) {
//        // 查询登录用户关联科室
//        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
//        params.put("userLinkDepts", deptIds);
//        JSONObject jsonObject = analysisSdsPortalService.selectQCCategory(params);
//        model.addAttribute("data", jsonObject);
//        return PREFIX +  "portalAutoRatio.html";
//    }

    /**
     * 跳转到病种填报用时分析列表
     */
    @RequestMapping("useTime")
    public String useTime(@RequestParam Map<String, Object> params, Model model) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        JSONObject jsonObject = analysisSdsPortalService.selectQCUseTime(params);
        model.addAttribute("data", jsonObject);
        return PREFIX + "portalUseTime.html";
    }

    /**
     * 跳转到病种填报用时分析列表
     */
    @RequestMapping("refARatio")
    public String refARatio(@RequestParam Map<String, Object> params, Model model) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        JSONObject jsonObject = analysisSdsPortalService.selectQCARatio(params);
        model.addAttribute("data", jsonObject);
        return PREFIX + "portalRefARatio.html";
    }

    /**
     * 跳转到病种十日填报分析列表
     */
    @RequestMapping("reportInTime")
    public String reportInTime(@RequestParam Map<String, Object> params, Model model) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        JSONObject jsonObject = analysisSdsPortalService.selectQCARatio(params);
        model.addAttribute("data", jsonObject);
        return PREFIX + "reportInTime.html";
    }

    /**
     *跳转病种质控触发统计
     */
    @RequestMapping("distrsta")
    public String distrsta(@RequestParam  Map<String, Object> params, Model model) {

        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        //获取部门信息
        JSONArray officMap = cdcHospitalService.getOfficeMap();
        //加载用户关联科室
        JSONArray departMap = sdsCommonService.getDepartMap(new HashMap<>());
        //获取全部病种
        JSONArray entityMap = sdsQcentityService.getUpEntityMap();
        //获取质控统计病种
        JSONObject jsonObject =  analysisSdsPortalService.selectQCCategory(params);


        model.addAttribute("data", jsonObject);
        model.addAttribute("officeMap", officMap);
        model.addAttribute("departMap", departMap);
        model.addAttribute("entityMap", entityMap);
//        model.addAttribute("idName", idName);
        return PREFIX + "potralDisTrSta.html";
    }

    /**
     *跳转医生质控触发统计
     */
    @RequestMapping("doctrsta")
    public String doctrsta(@RequestParam  Map<String, Object> params, Model model) {
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        //获取部门信息
        JSONArray officMap = cdcHospitalService.getOfficeMap();
        //加载用户关联科室
        JSONArray departMap = sdsCommonService.getDepartMap(new HashMap<>());
        //获取全部病种
        JSONArray entityMap = sdsQcentityService.getUpEntityMap();

        model.addAttribute("officeMap", officMap);
        model.addAttribute("departMap", departMap);
        model.addAttribute("entityMap", entityMap);
//        model.addAttribute("idName", idName);
        return PREFIX + "portalDocTrSta.html";
    }



    /**
     * @Description: 过程质控分析
     * @Title: analysisQcByMonth
     * @author: zhouxuan
     * @date:2022年10月10日 上午11:22:35
     */
    @RequestMapping("analysisQcTrend")
    public String analysisQcTrend(Model model) {
        //获取部门信息
        JSONArray officMap = cdcHospitalService.getOfficeMap();
        //加载用户关联科室
        JSONArray departMap = sdsCommonService.getDepartMap(new HashMap<>());
        //获取病种
        JSONArray entityMap = sdsQcentityService.getUpEntityMap();

        model.addAttribute("officeMap",officMap);
        model.addAttribute("departMap", departMap);
        model.addAttribute("entityMap", entityMap);
        model.addAttribute("hospitalId", sdsCommonService.getHospIdBySysUser());
        return PREFIX + "analysisQcTrend.html";
    }
    /**
     * @Description: 查询质控统计数据
     * @Title: selectQcTrendData
     * @param params
     * @return: Object
     * @author: zhouxuan
     * @date:2022年10月11日 上午11:23:02
     */
    @RequestMapping("selectQcTrendData")
    @ResponseBody
    public Object selectQcTrendData(@RequestParam Map<String, Object> params) {
        return sdcBusiQcTriggeredService.selectQcTrendData(params);
    }
    @RequestMapping(value = "/getQcTrendDic")
    @ResponseBody
    public Object getQcTrendDic(@RequestParam Map<String, String> params) {
        return sdcQcAnalysisDicService.getQcTrendDic();
    }
    /**
     * 点击数字跳转页面
     * @param
     * @param model
     * @return
     */
    @RequestMapping("/to_QcCaseDetail")
    public String to_QcCaseDetail(@RequestParam Map<String, Object> map,Model model) {
        model.addAttribute("date", map.get("date"));
        model.addAttribute("dateRange", map.get("dateRange"));
        model.addAttribute("startDate", map.get("startDate"));
        model.addAttribute("endDate", map.get("endDate"));
        model.addAttribute("depart", map.get("depart"));
        model.addAttribute("meidcalGroup", map.get("meidcalGroup"));
        model.addAttribute("office", map.get("office"));
        model.addAttribute("entityType", map.get("entityType"));
        model.addAttribute("doctor", map.get("doctor"));
        return PREFIX + "qcCaseDetail.html";
    }
    /**
     * 获取触发质控的患者数据
     * @param params
     * @return
     */
//    @SuppressWarnings("unchecked")
    @RequestMapping("/qcCaseList")
    @ResponseBody
    public Object qcCaseList(@RequestParam Map<String, Object> params) {
        return sdcBusiQcTriggeredService.getQcCaseList(params);
    }
    /**
     * @Desc 患者触发质控项页面
     * @param params
     * @param model
     * @return
     * @Author zhouxuan
     * @Date 2022年1月27日 下午3:02:42
     */
    @RequestMapping("/to_qcDetail")
    public String to_qcDetail(@RequestParam Map<String, Object> params,Model model) {
        String episodeId = params.get("episodeId").toString();
        model.addAttribute("episodeId",episodeId);
        return PREFIX + "qcDetail.html";
    }
    /**
     * VTE风险评估历史
     * @param params
     * @author zhouxuan
     * @return
     */
    @RequestMapping(value = "/qcDetailList")
    @ResponseBody
    public Object qcDetailList(@RequestParam Map<String, Object> params) {
        return sdcBusiQcTriggeredService.selectQcDetailList(params);

    }
    /**
     * @Description: 上报趋势分析
     * @Title: analysisReportTrend
     * @author: zhouxuan
     * @date:2022年10月10日 上午11:22:35
     */
    @RequestMapping("/analysisReportTrend")
    public String analysisReportTrend(Model model) {
        //获取部门信息
        JSONArray officMap = cdcHospitalService.getOfficeMap();
        //加载用户关联科室
        JSONArray departMap = sdsCommonService.getDepartMap(new HashMap<>());
        //获取病种
        JSONArray entityMap = sdsQcentityService.getUpEntityMap();

        model.addAttribute("officeMap",officMap);
        model.addAttribute("departMap",departMap);
        model.addAttribute("entityMap", entityMap);
        model.addAttribute("hospitalId", sdsCommonService.getHospIdBySysUser());
        return PREFIX + "analysisReportTrend.html";
    }
    @RequestMapping(value = "/getReportTrendDic")
    @ResponseBody
    public Object getReportTrendDic(@RequestParam Map<String, String> params) {
        return sdcReportAnalysisDicService.getReportTrendDic();
    }
    /**
     * @Description: 查询上报分析页面数据
     * @Title: selectReportTrendData
     * @param params
     * @return: Object
     * @author: zhouxuan
     * @date:2022年10月11日 上午11:23:02
     */
    @RequestMapping("selectReportTrendData")
    @ResponseBody
    public Object selectReportTrendData(@RequestParam Map<String, Object> params) {
        return sdcBusiQcTriggeredService.selectReportTrendData(params);
    }
    /**
     * 跳转上报分析二级页面
     */
    @RequestMapping("sendPatTrendCase")
    public String sendPatTrendCase(@RequestParam Map<String, Object> params,Model model ){
        model.addAttribute("key", params.get("key"));
        model.addAttribute("desc",params.get("desc"));
        model.addAttribute("dishDate", params.get("dishDate"));
        model.addAttribute("office",params.get("office"));
        model.addAttribute("depart",params.get("depart"));
        model.addAttribute("entityType",params.get("entityType"));
        model.addAttribute("doctor",params.get("doctor"));
        return PREFIX + "patTrendCase.html";
    }
    /**
     *  查询上报分析二级页面病人数据
     */
    @RequestMapping("selectPatTrendCaseList")
    @ResponseBody
    public Object selectPatTrendCaseList(@RequestParam Map<String ,Object> params){

        return sdcBusiQcTriggeredService.selectPatTrendCaseList(params);
    }
    /**
     *  跳转已展开病种统计页面
     */
    @RequestMapping("devlistofdis")
    public String devlistofdis(@RequestParam Map<String,Object> params){

        return PREFIX + "devlistofdis.html";
    }

    /**
     *  跳转到迟报页面
     */
    @RequestMapping("delayReport")
    public String toDelayReport(@RequestParam Map<String,Object> params,Model model){
        //获取病种
        JSONArray entityMap = sdsQcentityService.getUpEntityMap();
        // 单病种医生是否可以直接上报配置
        String formCheckType = CdcConfigCache.me().getValueByKey("SDS", "SDFormCheckType");
        // 是否启用过程质控
        String enableIPQC = CdcConfigCache.me().getValueByKey("SDS", "EnableIPQCModule");
        model.addAttribute("formCheckType", formCheckType);
        model.addAttribute("enableIPQC", enableIPQC);
        model.addAttribute("entityMap", entityMap);
        return PREFIX + "delayReport.html";
    }

    /**
     * 查询已开展病种
     */
    @RequestMapping("selectdevlist")
    @ResponseBody
    public Object selectdevlist(@RequestParam Map<String,Object> params){
        // 查询登录用户关联科室
        List<String> deptIds = sdsCommonService.getDeptIdsBySysUser();
        params.put("userLinkDepts", deptIds);
        return analysisSdsPortalService.selectdevlist(params);
    }
}
